<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #F8F9FA;
}
-->
</style>
<script language="javascript" src="js/jquery.js"></script>
<script language="javascript" src="js/tip.js"></script>
<script type="text/javascript">
function addtr(){
str="<tr id='after'><td height='30' width='44' bgcolor='#f2f2f2' class='left_txt'></td><td height='30' width='202' bgcolor='#f2f2f2' class='left_txt'>description：<input type='text' name='intro[]'></td><td  height='30' bgcolor='#f2f2f2' width='242' class='left_txt'>链接：<input type='text' name='images_link[]'></td><td  height='30' colspan='4' bgcolor='#f2f2f2' class='left_txt'>上传文件：<input type='file' name='fileDoc[]'></td></tr>";
$(str).insertAfter('#after');
$("#after").removeAttr("id");
}
function setClicks(ids,obj){
	var yes = $(obj).attr('src').match(/yes/i);
	$.post("index_images.php",
		   {action:'show',id:ids},
		   function(data){
				if(data.ret=="ok"){
					$(obj).attr('src',"images/"+data.status+".gif");
					if (yes) $(obj).attr('title','show');
					else $(obj).attr('title','hide');
				}else{
					//失败
				}
			},'json');

}
function del(id)
{
	if(confirm('Are you sure to delete？'))
	{
		$.post("index_images.php",{delid:id},function(data,textStatus)
				{
			if(data!=1)
			{info="Success";
			 msg(info);
			}
			else
			{
				info="Failure";
				msg(info);
			}
			});
	}
}
</script>

<link href="images/skin.css" rel="stylesheet" type="text/css" />
<body>
<form name="form1" action="" method="post" enctype="multipart/form-data">
<table width="100%" border="0" ceindellpadding="0" cellspacing="0">
  <tr>
    <td width="17" height="29" valign="top" background="images/mail_leftbg.gif"><img src="images/left-top-right.gif" width="17" height="29" /></td>
    <td width="935" height="29" valign="top" background="images/content-bg.gif"><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
      <tr>
        <td height="31"><div class="titlebt" style="text-indent:6px">Image Config</div></td>
      </tr>
    </table></td>
    <td width="16" valign="top" background="images/mail_rightbg.gif"><img src="images/nav-right-bg.gif" width="16" height="29" /></td>
  </tr>
  <tr>
    <td height="71" valign="middle" background="images/mail_leftbg.gif">&nbsp;</td>
    <td valign="top" bgcolor="#F7F8F9"><table width="100%" height="138" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td height="13" valign="top">&nbsp;</td>
      </tr>
      <tr>
        <td valign="top"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td class="left_txt">CURRENT：Home Rotation Images Config</td>
          </tr>
          <tr>
            <td><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="nowtable">
              <tr>
                <td class="left_bt2" style="padding-left:10px;"  width="60" >No.</td> <td class="left_bt2" width="171">Image Thumb</td><td width="254" class="left_bt2">Image Link</td><td width="208" class="left_bt2">Show</td><td width="279" class="left_bt2">Add-Time</td><td width="164" class="left_bt2">Operation</td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <{foreach item=loop from=$index_image}>
              <tr>
                <td width="44" height="30" style="padding-left:10px; text-align:left" bgcolor="#f2f2f2" class="left_txt"><{$loop.id}></td>
                <td width="202" bgcolor="#f2f2f2" class="left_txt"><img width="50px" height="15px" src="upload/ori/<{$loop.images_url}>"></td>
                <td width="242" height="30" bgcolor="#f2f2f2"class="left_txt"><{$loop.images_link}></td>
                <td width="208" height="30" bgcolor="#f2f2f2" class="left_txt">
                <{if $loop.is_show==0}>
	 <img id="show<{$loop.id}>" src="images/no.gif" onClick="setClicks(<{$loop.id}>,this)" width="14" height="14" />
	 <{/if}>
	 <{if $loop.is_show==1}>
	 <img id="show<{$loop.id}>" src="images/yes.gif" onClick="setClicks(<{$loop.id}>,this)" width="14" height="14" />
	 <{/if}>

                </td>
                <td width="277" height="30" class="left_txt" bgcolor="#f2f2f2"><{$loop.add_time|truncate:10:true}></td>
                <td width="164" height="30" bgcolor="#f2f2f2" class="left_txt"><a style="cursor:pointer;" onclick="del(<{$loop.id}>)"><img src="images/icon_trash.gif" border="0"/></td>
             </tr>
             <{/foreach}>

           <tr id="after">
           <td height="30" width="44" bgcolor="#f2f2f2" class="left_txt">&nbsp;&nbsp;<a href="javascript:void(0)" onClick="addtr()"><img src="images/biao2.jpg" border="0"></a></td>
           <td height="30" width="202" bgcolor="#f2f2f2" class="left_txt">Description：<input type="text"  name="intro[]"></td>
           <td  height="30" bgcolor="#f2f2f2" width="242" class="left_txt">Link：<input type="text"  name="images_link[]"></td>
           <td  height="30" colspan="4" bgcolor="#f2f2f2" class="left_txt">Upload Image：<input type="file"  name="fileDoc[]"></td>
           </tr>
              <tr>
                <td height="17" colspan="4" align="right" >&nbsp;</td>
              </tr>
            </table></td>
          </tr>
        </table>
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="50%" height="30" align="center"><input type="submit" value="Submit" name="submit" /></td>
            </tr>
            <tr>
              <td height="30" colspan="3">&nbsp;</td>
            </tr>
          </table></td>
      </tr>
    </table></td>
    <td background="images/mail_rightbg.gif">&nbsp;</td>
  </tr>
  <tr>
    <td valign="middle" background="images/mail_leftbg.gif"><img src="images/buttom_left2.gif" width="17" height="17" /></td>
      <td height="17" valign="top" background="images/buttom_bgs.gif"><img src="images/buttom_bgs.gif" width="17" height="17" /></td>
    <td background="images/mail_rightbg.gif"><img src="images/buttom_right2.gif" width="16" height="17" /></td>
  </tr>
</table>
</form>
</body>
